package com.example.springboot01.execs;

import com.example.springboot01.resp.enums.RespEnum;

public class CustomException extends RuntimeException{

    protected int code;

    public CustomException(String message) {
        super(message);
    }

    public CustomException(int code, String message) {
        super(message);
        this.code = code;
    }

    public CustomException(RespEnum respEnum) {
        this(respEnum.getMsg());
        this.code = respEnum.getCode();
    }

    public int getCode() {
        return code;
    }
}
